//守卫
private _pos = _this select 0;
private _num = _this select 1;
private _list = _this select 2;

_num = round(_num * Param_EnemySpawnNum * call fn_aiNum);

private _group = grpNull;
if(!surfaceIsWater _pos) then
{
	_group = createGroup resistance;

	for "_i" from 1 to _num do
	{
		[selectRandom _list, _pos, 2, _group] call fn_createUnit;	
	};
	
	_group setBehaviour "SAFE";//守卫默认休闲
	_group spawn fn_squadAI;
	
	//进驻建筑
	if(Param_Debug == 1)then{systemChat "守卫进驻建筑！"};
	[_group, 150] call fn_findBuildingCover;
	//[_group] spawn fn_controlGroup;
	
	if(Param_Debug == 1) then
	{
		_group addGroupIcon ["b_hq",[0,0]];
		_group setGroupIconParams [[0,1,0,1],"守卫",1,true];
	};
	
	_group enableDynamicSimulation true;
};

_group